package com.newer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newer.domain.Trre;
import com.newer.domain.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TrreMapper extends BaseMapper<Trre> {

    @Select("select u.*,ru.srId,r.*,rt.trId,t.* from t_role_user ru inner join t_user u on ru.userId=u.userId inner join t_role r on ru.roleId=r.roleId inner join t_role_trre rt on rt.roleId=r.roleId inner join t_trre t on rt.trreId=t.trreId")
    @Results({
            @Result(column = "userId",property = "userid"),
            @Result(column = "userName",property = "username"),
            @Result(column = "userPwd",property = "userpwd"),
            @Result(column = "realName",property = "realName"),
            @Result(column = "phone",property = "phone"),
            @Result(column = "state",property = "state"),
            @Result(column = "photo",property = "photo"),
            @Result(column = "photo",property = "photo"),
            @Result(column = "photo",property = "photo"),
            @Result(column = "photo",property = "photo"),
    })
    List<User> selectUserTrre();

}